package com.itheima.tcp.demo2;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo {
    public static void main(String[] args) throws IOException {
        ServerSocket ss=new ServerSocket(10000);
        Socket accept = ss.accept();
        InputStream inputStream = accept.getInputStream();
        int b;
        while((b=inputStream.read())!=-1){
            System.out.println((char)b);
        }
        OutputStream outputStream = accept.getOutputStream();

        BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(outputStream));
        bw.write("您是谁啊");
        bw.newLine();
        bw.flush();
        bw.close();
        accept.close();


    }
}
